package org.springframework.example.t0830.config;

import org.springframework.context.SmartLifecycle;
import org.springframework.stereotype.Component;

@Component
public class ContainerLifeCycle  implements SmartLifecycle {

	boolean isRunning = false;
	@Override
	public void start() {
		System.out.println("容器启动");
		isRunning =true;
	}

	@Override
	public void stop() {
		System.out.println("容器停止");
	}

	@Override
	public boolean isRunning() {
		return isRunning;
	}

	@Override
	public int getPhase() {
		//分组
		return 1;
	}
}
